﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Media;
using System.Windows;
using System.Windows.Controls;

namespace GravityDemo
{
    class Planet : IMassiveBody
    {
        private long mass;
        private double radius;

        public double xPosition;
        public double yPosition;

        public double xVelocity;
        public double yVelocity;

        public long Mass
        {
            get
            {
                return mass;
            }
            set
            {
                mass = value;
            }
        }

        public double Radius
        {
            get
            {
                return radius;
            }
            set
            {
                radius = value;
            }
        }

        public double XPosition
        {
            get
            {
                return xPosition;
            }
            set
            {
                xPosition = value;
            }
        }

        public double YPosition
        {
            get
            {
                return yPosition;
            }
            set
            {
                yPosition = value;
            }
        }

        public double XVelocity
        {
            get
            {
                return xVelocity;
            }
            set
            {
                xVelocity = value;
            }
        }

        public double YVelocity
        {
            get
            {
                return yVelocity;
            }
            set
            {
                yVelocity = value;
            }
        }

        public System.Windows.Controls.Image BodyImage
        {
            get
            {

                EllipseGeometry ellipse =  new EllipseGeometry(new Point(0, 50), radius, radius);
                DrawingImage drawingImage = new DrawingImage(new GeometryDrawing(Brushes.White, new Pen(Brushes.White, 1), ellipse));

                // Freeze the DrawingImage for performance benefits.
                drawingImage.Freeze();

                Image finalImage = new Image();
                finalImage.Source = drawingImage;

                return finalImage;
            }
        }
    }
}
